﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true" CodeBehind="AdsView.aspx.cs" Inherits="Thuoc24h.AdminCP.Pages.AdsView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
    <Telerik:RadGrid runat="server" AutoGenerateColumns="False" ID="gridData" CellSpacing="0" GridLines="None" Width="100%"
        AllowPaging="True" AllowCustomPaging="True" OnItemCommand="gridData_ItemCommand" AllowSorting="True">
        <MasterTableView ClientDataKeyNames="Id" DataKeyNames="Id" GroupLoadMode="Client" CommandItemDisplay="Top"
            PageSize="20" NoMasterRecordsText="Không có bản ghi nào.">
            <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Thêm mới" RefreshText="Tải lại" ShowAddNewRecordButton="True" ShowRefreshButton="True"></CommandItemSettings>
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <GroupByExpressions>
            </GroupByExpressions>
            <Columns>
                <Telerik:GridTemplateColumn HeaderText="STT" UniqueName="Id">
                    <ItemStyle HorizontalAlign="Left" CssClass="center" />
                    <ItemTemplate>
                        <%#
                   (gridData.PageSize * (gridData.CurrentPageIndex + 1)) - gridData.PageSize + Container.ItemIndex + 1
                        %>
                    </ItemTemplate>
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="50px" />
                </Telerik:GridTemplateColumn>
                <Telerik:GridTemplateColumn HeaderText="Quảng cáo" UniqueName="Order">
                    <ItemStyle HorizontalAlign="Left" CssClass="center" Width="60px" />
                    <ItemTemplate>
                        <img src=' <%#Eval("ImageUrl")%>' width="60px" />
                        <%#Eval("EmbedCode")%>
                    </ItemTemplate>
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                </Telerik:GridTemplateColumn>

                <Telerik:GridTemplateColumn HeaderText="Vị trí" UniqueName="Position">
                    <ItemStyle HorizontalAlign="Left" CssClass="center" Width="80px" />
                    <ItemTemplate>
                        <%#Eval("PositionId").Equals(2)? "Phải":"" %>
                        <%#Eval("PositionId").Equals(1)? "Banner":"" %>
                    </ItemTemplate>
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                </Telerik:GridTemplateColumn>

                <Telerik:GridTemplateColumn HeaderText="Thứ tự" UniqueName="Order">
                    <ItemStyle HorizontalAlign="Left" CssClass="center" Width="60px" />
                    <ItemTemplate>
                        <%#Eval("SortOrder")%>
                    </ItemTemplate>
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                </Telerik:GridTemplateColumn>
                <Telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Edit" ConfirmDialogType="RadWindow"
                    HeaderText="Sửa"
                    Text="Sửa" UniqueName="Edit">
                    <ItemStyle CssClass="center" Width="32px" />
                    <HeaderStyle HorizontalAlign="Center" Width="32px" Font-Bold="True" />
                </Telerik:GridButtonColumn>
                <Telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                    ConfirmText="Bạn có chắc chắn muốn xóa" ConfirmTitle="Xóa" HeaderText="X&#243;a"
                    Text="X&#243;a" UniqueName="Delete">
                    <ItemStyle CssClass="center" Width="32px" />
                    <HeaderStyle HorizontalAlign="Center" Width="32px" Font-Bold="True" />
                </Telerik:GridButtonColumn>
            </Columns>

            <EditFormSettings EditFormType="Template">
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>

            </EditFormSettings>

        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="True">
        </ClientSettings>
        <FilterMenu EnableImageSprites="False"></FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </Telerik:RadGrid>
</asp:Content>
